﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.UI;
using System.Web.UI.WebControls;
using BillBook.Controller;
using BillBook.Model;

public partial class admin_Default : System.Web.UI.Page
{
    [WebMethod]
    public static sbyte login(string username, string password)
    {
        UserController usercontroller = new UserController();
        User user = usercontroller.Authenticate(username, password);
        if (user != null)
        {
            HttpContext.Current.Session["loggeduser"] = user;
            return 1;
        }
        return 2;
    }
}
